﻿@{
    ViewBag.Title = "新增模块";
}
@model DotNet.Model.MyEntity.Base_Module      
<script src="/Scripts/jQuery/jquery.validate.min.js" type="text/javascript"></script>
<script src="/Scripts/jQuery/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $("#form_permission_module_create").submit(function () {
            return false;
        });
        if ("@ViewBag.Flag" == "Edit") {
            $("#form_permission_module_create").attr("action", "/Permission/Module/Editing");
            $("#btnSave_Permission_Module_Create").html("更新");
        } else {
            $("#ParentId").val("@ViewBag.ID");
        }
        $("#txtParentName").val("@ViewBag.ParentName");
        $("#clear_permission_module_create").click(function () {
            $("#txtParentName").val("");
            $("#ParentId").val("0");
        });
    });   
</script>
<div class="pageContentD">
    @{Html.EnableClientValidation();}
    @using (Html.BeginForm("Creating", "Module", null, FormMethod.Post, new { onsubmit = "return validateCallback(this,dialogAdded_Permission_Module);", @id = "form_permission_module_create", @class = "pageForm" }))
    {   
        <div class="pageFormContent" layouth="60">
            <table width="95%" class="tab01 tabNo">
                <tr>
                    <td class="td1" style="width:25%;">
                            父节点：
                    </td>
                    <td>
                        @Html.HiddenFor(m => m.Id)
                        @Html.HiddenFor(m => m.ParentId)
                        <input type="text" id="txtParentName" value="" onclick="return false;" class="input02 textInput" />
                        <a class="btnLook" href="/Permission/Module/SelectTree" target="dialog" rel="dialog_permisson_module_create" title="请选择..." mask="true" width="300" height="350"><span>选择</span></a> 
                        <a class="btnDel" id="clear_permission_module_create" href="javascript:void(0);"><span>置空</span></a>
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                            模块名称：
                    </td>
                    <td>
                        @Html.TextBoxFor(m => m.FullName, new Dictionary<string, object> { { "alt", "请输入名称" }, { "class", "input02" } })
                        @Html.ValidationMessageFor(m => m.FullName)
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                            编号：
                    </td>
                    <td>
                        @Html.TextBoxFor(m => m.Code, new Dictionary<string, object> { { "class", "input02" } })
                        @Html.ValidationMessageFor(m => m.Code)
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                            排序：
                    </td>
                    <td>
                        @Html.TextBoxFor(m => m.SortCode, new Dictionary<string, object> { { "class", "input02" }, { "data-val-required","*" } })
                        @Html.ValidationMessageFor(m => m.SortCode)
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                            图标地址：
                    </td>
                    <td>
                        @Html.TextBoxFor(m => m.ImageUrl, new Dictionary<string, object> { { "class", "input02" } })
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                            Web网址：
                    </td>
                    <td>
                        @Html.TextBoxFor(m => m.NavigateUrl, new Dictionary<string, object> { { "class", "input02" } })
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td align="center">
                        <input type="checkbox" name="Enabled" id="Enabled" value="1"  @Html.Raw(Model == null || Model.Enabled == null ? "checked='checked'" : (Model.Enabled == 1 ? "checked='checked'" : "")) />有效
                        &nbsp
                        <input type="checkbox" name="IsPublic" id="IsPublic" value="1"  @Html.Raw(Model == null || Model.IsPublic == null ? "checked='checked'" : (Model.IsPublic == 1 ? "checked='checked'" : "")) />公开
                    </td>
                </tr>
                <tr>
                    <td class="td1">
                            备 注：
                    </td>
                    <td>
                        @Html.TextAreaFor(m => m.Description, new Dictionary<string, object> { { "class", "input05" } })
                    </td>
                </tr>
            </table>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <button type="submit" class="btn btn-success btn-sm" id="btnSave_Permission_Module_Create">
                        保存</button>
                </li>
                <li>
                    <button type="button" class="close btn btn-default btn-sm">
                        取消</button>
                </li>
            </ul>
        </div>
    }
    @*</form>*@
</div>
